import { stringify } from 'qs';
import request from '@/utils/request';

export async function queryGroupsOptions() {
    return request('/api/groups/options');
}

export async function queryGroups(params) {
    return request(`/api/groups?${stringify(params)}`)
}

export async function del(params) {
    return request(`/api/groups/${params}`, {
      method: 'DELETE',
    });
}

export async function add(params) {
    return request('/api/groups', {
      method: 'POST',
      body: {
        ...params,
      },
    });
}

export async function detail(params) {
  return request(`/api/groups/${params}`)
}